﻿<Window x:Class="Dreambuild.Gis.Desktop.Demos.LowCarbon.BaseParamsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:svc="clr-namespace:Dreambuild.Gis.Desktop.Demos.LowCarbon"
        Title="基础参数" Height="500" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">


    <Grid Margin="0,0,0,0" Name="BaseParamsGrid">
        <Grid.Resources>
            <ObjectDataProvider x:Key="BaseParams" ObjectType="{x:Type svc:BaseParams}"/>
        </Grid.Resources>
        <Label Content="{DynamicResource Province}" HorizontalAlignment="Left" Margin="150,26,0,0" VerticalAlignment="Top"/>
        <ComboBox Name="CityComboBox" HorizontalAlignment="Left" Margin="216,30,0,0" VerticalAlignment="Top" Width="120" SelectionChanged="CityComboBox_SelectionChanged">
        </ComboBox>
        <Label Content="{DynamicResource Baseline}" HorizontalAlignment="Left" Margin="150,56,0,0" VerticalAlignment="Top"/>
        <ComboBox x:Name="BaseYearsComboBox" HorizontalAlignment="Left" Margin="216,60,0,0" VerticalAlignment="Top" Width="120" SelectionChanged="BaseYearsComboBox_SelectionChanged"/>

        <Label Content="{DynamicResource LifeTimeSpan}"  HorizontalAlignment="Left" Margin="150,86,0,0" VerticalAlignment="Top"/>

        <TreeView Margin="150,118,150,110">

            <TreeViewItem Header="{DynamicResource EnergySaveCriterion}" IsExpanded="True">
                <TreeViewItem>
                    <TreeViewItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <RadioButton Name="SavingRatioType" GroupName="SaveStandardGroup" Content="{DynamicResource EnergySaveRatio}" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="True" Checked="RadioButton_Checked"/>
                            <TextBox Name="SavingRatioTextBox" Width="70" Text="0" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Right" LostFocus="Within100IntValidation" TextChanged="SavingRatioTextBox_TextChanged"/>
                            <Label Content="%" HorizontalAlignment="Right" />
                        </StackPanel>
                    </TreeViewItem.Header>
                </TreeViewItem>
                <TreeViewItem>
                    <TreeViewItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <RadioButton Name="LeedStandardType" GroupName="SaveStandardGroup" Content="{DynamicResource AmericanLEEDCertification}" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Checked="RadioButton_Checked"/>
                            <ComboBox Name="LEEDComboBox" HorizontalAlignment="Left" Width="70" VerticalAlignment="Center" SelectionChanged="LEEDComboBox_SelectionChanged">
                                <ComboBoxItem Content="{DynamicResource Certified}" IsSelected="True" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                <ComboBoxItem Content="{DynamicResource Silver}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                <ComboBoxItem Content="{DynamicResource Gold}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                <ComboBoxItem Content="{DynamicResource Platinum}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </ComboBox>
                        </StackPanel>
                    </TreeViewItem.Header>
                </TreeViewItem>
                <TreeViewItem>
                    <TreeViewItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <RadioButton Name="ChineseGreenBuildingStandardType" GroupName="SaveStandardGroup" Content="{DynamicResource ChineseGreenBuildingStandard}" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Checked="RadioButton_Checked" />
                            <ComboBox Name="ChineseGreenBuildingStandar_ComboBox" HorizontalAlignment="Left" Width="70" SelectionChanged="ChineseGreenBuildingStandar_ComboBox_SelectionChanged" >
                                <ComboBoxItem Content="{DynamicResource OneStar}" IsSelected="True" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                <ComboBoxItem Content="{DynamicResource TwoStars}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                <ComboBoxItem Content="{DynamicResource ThreeStars}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </ComboBox>
                        </StackPanel>
                    </TreeViewItem.Header>
                </TreeViewItem>
            </TreeViewItem>

            <TreeViewItem Header="{DynamicResource EnergyStructure}" IsExpanded="True">
                <TreeViewItem>
                    <TreeViewItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="{DynamicResource CoalElectricityRatio}" Width="120" HorizontalAlignment="Left" />
                            <TextBox Width="70" Text="{Binding CoalElectricityRatio, Mode=TwoWay}" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Right" LostFocus="Within100IntValidation"/>
                            <Label Content="%" HorizontalAlignment="Right" />
                        </StackPanel>
                    </TreeViewItem.Header>
                </TreeViewItem>

                <TreeViewItem>
                    <TreeViewItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="{DynamicResource NaturalGasRatio}" Width="120" HorizontalAlignment="Left" />
                            <TextBox Width="70" Text="{Binding NaturalGasRatio, Mode=TwoWay}" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Right" LostFocus="Within100IntValidation" />
                            <Label Content="%" HorizontalAlignment="Right" />
                        </StackPanel>
                    </TreeViewItem.Header>
                </TreeViewItem>

                <TreeViewItem>
                    <TreeViewItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="{DynamicResource OtherCleanEnergyRatio}" Width="120" HorizontalAlignment="Left" />
                            <TextBox Width="70" Text="{Binding OtherCleanEnergyRatio, Mode=TwoWay}" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Right" LostFocus="Within100IntValidation"/>
                            <Label Content="%" HorizontalAlignment="Right" />
                        </StackPanel>
                    </TreeViewItem.Header>
                </TreeViewItem>

                <TreeViewItem>
                    <TreeViewItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="{DynamicResource PowerC02EmissionFactor}" Width="120" HorizontalAlignment="Left" />
                            <TextBox x:Name="ElectricityCO2FactorTextBox" Width="70" Text="{Binding ElectricityProductionFactor, Mode=TwoWay}" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" />
                            <Label Content="kg/(kW·h)" Width="100" HorizontalAlignment="Right" />
                        </StackPanel>
                    </TreeViewItem.Header>
                </TreeViewItem>
                <TreeViewItem>
                    <TreeViewItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="{DynamicResource NaturalGasC02EmissionFactor}" Width="140" HorizontalAlignment="Left" />
                            <TextBox x:Name="GasCO2FactorTextBox" Width="70" Text="{Binding GasProductionFactor,Mode=TwoWay}" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" />
                            <!--Text="{Binding CO2Factor,Mode=TwoWay}"-->
                            <Label Content="kg/(kW·h)" Width="100" HorizontalAlignment="Right" RenderTransformOrigin="0.719,0.578" />
                        </StackPanel>
                    </TreeViewItem.Header>
                </TreeViewItem>
            </TreeViewItem>
            
        </TreeView>
        <Button Content="{DynamicResource Confirm}" HorizontalAlignment="Left" Margin="441,366,0,0" VerticalAlignment="Top" Width="75" RenderTransformOrigin="0.744,0.767" Click="OK_Button_Click"/>
        <Button Content="{DynamicResource Cancel}" HorizontalAlignment="Left" Margin="556,366,0,0" VerticalAlignment="Top" Width="75" Click="Cancel_Button_Click"/>
        <TextBox HorizontalAlignment="Left" Height="23" Margin="216,88,0,0" TextWrapping="Wrap" TextAlignment="Center"  Text="{Binding LifeCycle,Mode=TwoWay}"  VerticalAlignment="Top" Width="120"/>
        <Label Content="a" HorizontalAlignment="Left" Margin="341,88,0,0" VerticalAlignment="Top"/>

    </Grid>
</Window>
